<?php defined('IN_IA') or exit('Access Denied');?><?php  include $this->template(wl_header, TEMPLATE_INCLUDEPATH);?> 
<link href='<?php echo RES;?>css/cart.css' rel='stylesheet' type='text/css' />

<link rel="stylesheet" type="text/css" href="<?php echo RES;?>css/wei_canyin.css" media="all" />
<link rel="stylesheet" type="text/css" href="<?php echo RES;?>css/wei_dialog.css" media="all" />
<link rel="stylesheet" type="text/css" href="<?php echo RES;?>css/datepicker_canyin.css" media="all" />

<script type="text/javascript" src="<?php echo RES;?>js/wei_webapp_v2_common.js"></script>
<script type="text/javascript" src="<?php echo RES;?>js/bootstrap-datepicker_canyin.js"></script>

<!--script language="javascript">$(document).ready(shop_obj.payment_init);</script-->

<div id="shop_page_contents">
	<div id="cover_layer"></div>
	<?php  include $this->template(wl_menu, TEMPLATE_INCLUDEPATH);?> 
	<div id="payment">
		<div class="i-ture">
			<div class="info">
				订 单 号：<?php  echo $order['ordersn'];?><br />
				支付金额：<span class="fc_red">￥<?php  echo number_format($order['totalprice'],2)?></span>
			</div>
		</div>
		<form id="payment_form" action="<?php  echo $this->createMobileUrl('wlpayment');?>" method="post">
            <div class="i-ture">
            
				<h1 class="t">选择支付方式</h1>
				<ul>
					<li><input type="radio" name="paytype" value="2" id="zfb" checked /> <label for="zfb"><strong>微信支付</strong></label></li>
				</ul>
                
                
			</div>
            <div class="i-ture">
            <h1 class="t">取菜信息</h1>
            <ul>
            <li>

            </li>
            </ul>
            <table class="table_book">
                    <tr>
                    <td style="width:80px;">选取菜点:</td>
                    <td colspan="2">
            <select name="stationid" id="stationid" style="width: 100%;">
            <?php  if(is_array($pointlist)) { foreach($pointlist as $row) { ?>
            <option value="<?php  echo $row['id'];?>"<?php  if($row['id']==$fans["stationid"]){ echo "selected";}?>><?php  echo $row['title'];?></option>
            <?php  } } ?>
            </select>                    
                    </td>
                    </tr>            
                    <tr>
                    <td style="width:80px;">取菜时间：</td>
                    <td colspan="2">
                        <input id="dpd1" type="text" name="time_day" readonly="readonly" value="<?php  echo $dayof;?>" style="width:100px;"/>
                        <select name="time_hour">
                                                            <option value="10" <?php  if($fans['time_hour']=="10"){ echo "selected";} ?>>10时</option>
                                                            <option value="11" <?php  if($fans['time_hour']=="11"){ echo "selected";} ?>>11时</option>
                                                            <option value="12" <?php  if($fans['time_hour']=="12"){ echo "selected";} ?>>12时</option>
                                                            <option value="13" <?php  if($fans['time_hour']=="13"){ echo "selected";} ?>>13时</option>
                                                            <option value="14" <?php  if($fans['time_hour']=="14"){ echo "selected";} ?>>14时</option>
                                                            <option value="15" <?php  if($fans['time_hour']=="15"){ echo "selected";} ?>>15时</option>
                                                            <option value="16" <?php  if($fans['time_hour']=="16"){ echo "selected";} ?>>16时</option>
                                                            <option value="17" <?php  if($fans['time_hour']=="17"){ echo "selected";} ?>>17时</option>
                                                            <option value="18" <?php  if($fans['time_hour']=="18"){ echo "selected";} ?>>18时</option>
                                                    </select>
                        <select name="time_second">
                                                            <option value="00" <?php  if($fans['time_second']=="00"){ echo "selected";} ?>>00分</option>
                                                            <option value="10" <?php  if($fans['time_second']=="10"){ echo "selected";} ?>>10分</option>
                                                            <option value="20" <?php  if($fans['time_second']=="20"){ echo "selected";} ?>>20分</option>
                                                            <option value="30" <?php  if($fans['time_second']=="30"){ echo "selected";} ?>>30分</option>
                                                            <option value="40" <?php  if($fans['time_second']=="40"){ echo "selected";} ?>>40分</option>
                                                            <option value="50" <?php  if($fans['time_second']=="50"){ echo "selected";} ?>>50分</option>
                                                    </select>
                    </td>
                 </tr>
                <tr>
                    <td style="width:80px;">用户姓名：</td>
                    <td colspan="2">
                        <input type="text" name="guest_name" id="guest_name" value="<?php  echo $fans['nickname'];?>" placeholder="(必填*)请输入您的姓名" maxlength="30" style="width:200px;" class="input_text"/>
                    </td>
                </tr>
                <tr>
                    <td width="80px" style="width:80px;">手机号码：</td>
                    <td colspan="2"><input type="tel" id="tel" name="tel" value="<?php  echo $fans['mobile'];?>" maxlength="11" placeholder="(必填*)请输入您的手机号码" style="width:200px;" class="input_text"/></td>
                </tr>     
            <tr>
                    <td style="width:80px;vertical-align:top;line-height:25px;">备注说明：</td>
                    <td colspan="2">
                        <textarea name="remark" style="height:60px;" maxlength="100" class="input_text"></textarea>
                    </td>
                </tr>                           
                </table>            
            </div>
			<div class="payment"><input type="submit" value="下一步"  id="submit_form" /></div>
			<input type="hidden" name="orderid" value="<?php  echo $order['id'];?>" />
			<input type="hidden" name="d" value="payment" />
		</form>
	</div>
</div>
<link rel="stylesheet" type="text/css" href="<?php echo RES;?>css/wei_canyin.css" media="all" />
<div class="center">
<?php  include $this->template(wl_footer, TEMPLATE_INCLUDEPATH);?> 
<script>
    window.addEventListener("DOMContentLoaded", function() {
        var now = new Date();
        var nowArr = [now.getFullYear(), now.getMonth() + 1, now.getDate()];
        $("#dpd1").each(function(k, v) {
            var ndate = $(v).datepicker({
                format: "yyyy/mm/dd",
                onRender: function(date) {
                    var t1 = new Date(date.valueOf());
                    var t2 = new Date(now.valueOf());
                    t1 = t1.getFullYear() + "/" + (t1.getMonth() + 1) + "/" + t1.getDate();
                    t2 = t2.getFullYear() + "/" + (t2.getMonth() + 1) + "/" + t2.getDate();
                    return (t1 != t2 && (date.valueOf() < now.valueOf())) ? 'disabled' : '';
                }
            }).on("changeDate", function(date) {
                if ('days' == date.viewMode) {
                    ndate.datepicker('hide');
                }
            });
           // v.value = nowArr.join("/");
        });
        //
    }, false);
    window.addEventListener("DOMContentLoaded", function() {
        
    }, false);
            
            var footer = document.getElementById("footer_menu");
            var evtObj = {
                handleEvent: function(evt){
                    if("A" == evt.target.tagName){
                        evt.target.classList.toggle("on");
                    }
                }
            }
            footer.addEventListener("touchstart", evtObj, false);
            footer.addEventListener("touchend", evtObj, false);
        </script>
        

<script type="text/javascript">
    $(function() {
        $('#submit_form').click(function() {
            
            if (null == $('#tel').val().match(/^1\d{10,13}$/g)) {
                alert("请输入正确的手机号");return false;
                MDialog.alert(null, "请输入正确的手机号", null, "确定");
                return false;
            }
            
            if($("#guest_name").val() == ''){
                alert("请输入用户姓名");return false;
//                MDialog.alert(null, "请输入用户姓名", null, "确定");
//                return false;
            }
  
        });
    });

</script>
        
    </div>

